<?php
require_once("Dimension1.php");
/**
 * Description of Dimension2
 *
 * @author yahn
 */
class Dimension2 {
    private $dimension1; 
    private $dimension2;
    private $titre, $descr;
    private $lesDimensions3 = array();
    private $lesDimensions4 = array();

    
    public function __construct(Dimension1 $d1, $d2, $titre, $descr) {
        $this->dimension1 = $d1;
        $this->dimension2 = $d2;
        $this->titre = $titre;
        $this->descr = $descr;
    }    
    
    public function setDimension1(Dimension1 $d1) {
        $this->dimension1 = $d1;
    }
    public function getDimension1() {
        return $this->dimension1;
    }
    
    public function setDimension2(Dimension2 $d2){
        $this->dimension2 = $d2;
    }
    public function getDimension2() {
        return $this->dimension2;
    }
    
    public function setTitre($titre){
        $this->titre = $titre;
    }
    public function getTitre() {
        return $this->titre;
    }
    
    public function setDescr($descr){
        $this->descr = $descr;
    }
    public function getDescr() {
        return $this->descr;
    }
    
    public function addDimension3($d3) {
        
        if (is_array($d3)) {
            
            $this->lesDimensions3= $d3;
            
        }else {
            $this->lesDimensions3[] = $d3;
        }
    }
    
    public function getLesDimension3() {
        return $this->lesDimensions3;
    }
    
    public function __toString() {
        return "<br> <b><i>Dimension 2</i></b>: <br> <u>Titre :</u> ".$this->titre."<br><u>Descr :</u>".$this->descr." ".$this->dimension1;
    }
    
}
?>
